package com.droowa.model.dao;

import java.sql.SQLException;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.droowa.domain.ExchangeManagement;

@Repository
public class ExchangeManagementDAOMybatisImpl implements ExchangeManagementDAO {
	
	@Autowired
	private SqlSessionTemplate session;

	public int insertExchangeManagement(ExchangeManagement exchangeManagement)throws SQLException {
		return session.insert(makeSqlId("insertExchangeManagement"),exchangeManagement);
	}

	public int updateExchangeManagement(ExchangeManagement exchangeManagement)throws SQLException {
		return session.update(makeSqlId("updateExchangeManagement"), exchangeManagement);
	}

	public int deleteExchangeManagement(String orderNumber) throws SQLException {
		return session.delete(makeSqlId("deleteExchangeManagement"), orderNumber);
	}
	
	
	public List<ExchangeManagement> selectExchangeManagementByAll(HashMap map)throws SQLException {		
		return session.selectList(makeSqlId("selectExchangeManagementByAll"),map);
	}

	private String makeSqlId(String id){
		return "droowa.ExchangeManagement."+id;
	}
}